load("//bazel:api.bzl", "modular_py_library", "requirement")

package(default_visibility = ["//max:consumers"])

modular_py_library(
    name = "telemetry",
    srcs = glob(["*.py"]),
    imports = ["../../.."],
    deps = [
        "//max/python/max/serve:config",
        "//max/python/max/serve:process_control",
        requirement("opentelemetry-sdk"),
        requirement("opentelemetry-exporter-otlp-proto-http"),
        requirement("opentelemetry-exporter-prometheus"),
        requirement("python-json-logger"),
        requirement("uvicorn"),  # to host /metrics endpoint as it runs in a different process
    ],
)
